import { createVuePlugin } from 'vite-plugin-vue2'
import viteCompression from 'vite-plugin-compression';
import { svgBuilder } from './static/plugins/svgBuilder'
const path = require('path')
export default {
    plugins: [createVuePlugin(), viteCompression(), svgBuilder('./src/assets/svg/')],
    vue$: 'vue/dist/vue.esm.js',
    resolve: {
        alias: {
            '@': path.resolve(__dirname, './src'),
            '@component': path.resolve(__dirname, './src/views/components'),
            '@api': path.resolve(__dirname, './src/utils/api'),
            '@validator': path.resolve(__dirname, './src/utils/validator')
        }
    },
    server: {
        host: '0.0.0.0',
    },
    build: {

        rollupOptions: {
            compress: {
                drop_console: true,
                drop_debugger: true
            },
            output: {
                chunkFileNames: 'vuefront/static/js/[name]-[hash].js',
                entryFileNames: 'vuefront/static/js/[name]-[hash].js',
                assetFileNames: 'vuefront/static/[ext]/[name]-[hash].[ext]',
            }
        }
    }
    // 测试环境下 打包将index.html丢到static文件夹下
}
